# -*- coding: utf-8 -*-
# @Time    : 2024/8/30 9:43
# @Author  : qd
# @Email   : 1518603573@qq.com
# @File    : host_page.py
# @Software: PyCharm
from pages.login_page import LoginPage
from selenium.webdriver.common.by import By
class HostPage(LoginPage):
    url = "/crm/index.php?m=dynamic&a=index"
    chance_btn_locator = (By.CSS_SELECTOR,"body > div.navbar.navbar-inverse.navbar-fixed-top > div > div > div.nav-collapse.collapse > ul:nth-child(1) > li:nth-child(3) > a")
    fiance_btn_locator = (By.CSS_SELECTOR,"body > div.navbar.navbar-inverse.navbar-fixed-top > div > div > div.nav-collapse.collapse > ul:nth-child(1) > li:nth-child(8) > a")
    product_locator = (By.CSS_SELECTOR,"body > div.navbar.navbar-inverse.navbar-fixed-top > div > div > div.nav-collapse.collapse > ul:nth-child(1) > li:nth-child(4) > a")

    source_btn_locator = (By.LINK_TEXT, "线索")  # 线索按钮
    contract_btn_locator = (By.LINK_TEXT, "合同")  # 合同
    more_locator = (By.CLASS_NAME, "dropdown-toggle")  # 更多按钮
    knowledge_btn_locator = (By.LINK_TEXT, "知识")  # 知识按钮


    task_locator = (By.LINK_TEXT, '任务')  #任务
    client_locator = (By.LINK_TEXT, '客户')  #客户
    #营销
    marking_locator = (By.CSS_SELECTOR,'body > div.navbar.navbar-inverse.navbar-fixed-top > div > div > div.nav-collapse.collapse > ul:nth-child(1) > li.dropdown.open > ul > li:nth-child(3) > a')



    """点击商机"""
    def click_chance_btn(self):
        self.driver.find_element(*self.chance_btn_locator ).click()
    """点击财务"""
    def click_fiance_btn(self):
        self.driver.find_element(*self.fiance_btn_locator).click()
    """点击产品"""
    def click_product_btn(self):
        self.driver.find_element(*self.product_locator).click()


    def click_source_btn(self):
        """点击线索"""
        self.driver.find_element(*self.source_btn_locator).click()
    def click_contract_btn(self):
        """点击合同"""
        self.driver.find_element(*self.contract_btn_locator).click()
    def  click_task(self):
        """点击任务"""
        self.driver.find_element(*self.task_locator).click()
    def click_client(self):
        """点击客户"""
        self.driver.find_element(*self.client_locator).click()
    def click_more(self):
        """点击更多"""
        self.driver.find_element(*self.more_locator).click()
    def click_knowledge_btn(self):
        """点击知识"""
        self.driver.find_element(*self.knowledge_btn_locator).click()
    def click_marking(self):
        """点击营销"""
        self.driver.find_element(*self.marking_locator).click()